package com.itheima.config;

import org.mybatis.spring.mapper.MapperScannerConfigurer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class MapperConfig {

    // 创建一个mapper代理对象
    @Bean
    public MapperScannerConfigurer getMapper(){
        //1. 获取MapperScannerConfigurer对象
        MapperScannerConfigurer msc = new MapperScannerConfigurer();
        //2. 指定生成需要代理对像的接口包
        msc.setBasePackage("com.itheima.mapper");
        return msc;
    }
}
